import request from '@/config/axios'
import type { OnceData } from './types'

export const getOnceListApi = (params: any): Promise<IResponse> => {
    const queryParams = params.queryParams ? params.queryParams : {}
    if (params.queryParams) {
        delete params.queryParams
    }
    Object.assign(params, queryParams)
    return request.get({url: '/history/page', params})
}

export const checkOnceDetailApi = (row: Partial<OnceData>): Promise<IResponse> => {
    const data = {company_id:row.company_id, user_id:row.user_id, file_id:row.file_id};
    return request.post({url: '/history/check', data})
}

export const backOnceListApi = (row: Partial<OnceData>): Promise<IResponse> => {
    const data = {company_id:row.company_id, user_id:row.user_id, file_id:row.file_id};
    return request.post({url: '/history/data', data})
}
